package cn.iocoder.an.module.business.dal.dataobject.equipmnetkeepwait;

import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import java.time.LocalDate;
import java.util.*;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.an.framework.mybatis.core.dataobject.BaseDO;

/**
 * 待保养设备 DO
 *
 * @author zzy
 */
@TableName(value = "business_equipmnet_keep_wait",autoResultMap = true)
@KeySequence("business_equipmnet_keep_wait_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EquipmnetKeepWaitDO extends BaseDO {

    /**
     * id
     */
    @TableId
    private Long id;
    /**
     * 保养单号
     */
    private String keepNo;
    /**
     * 保养项id
     */
    private Long itemId;
    /**
     * 设备id
     */
    private Long equipmentId;
    /**
     * 设备名称
     */
    private String equipmentName;
    /**
     * 保养状态
     */
    private Integer status;
    /**
     * 计划保养日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate planDate;
    /**
     * 剩余天数
     */
    private Integer remaining;
    /**
     * 责任人ID
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<Long> dutyUserId;
    /**
     * 责任人名称
     */
    private String dutyUserName;
    /**
     * 派工时间
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private LocalDateTime sendTime;

    //是否是审核人或管理员
    @TableField(exist = false)
    private boolean reviewerPermission;

    //预警颜色
    @TableField(exist = false)
    private String color;

}